Skip to content

perf(mobile): speed up large Android threads - #5393

Draft
shivamhwp wants to merge 3 commits into
pingdotgg:mainfrom
shivamhwp:perf/android-large-thread-loading
Draft

perf(mobile): speed up large Android threads#5393
shivamhwp wants to merge 3 commits into
pingdotgg:mainfrom
shivamhwp:perf/android-large-thread-loading

Conversation

@shivamhwp

@shivamhwp shivamhwp commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Large Android threads spend too much time deriving and mounting feed rows, while a cold thread route swaps header implementations during hydration and visibly moves the title and actions.

This draft is now intentionally mobile-only:

  • hide the Android native thread header at route definition time and render loading, unavailable, and hydrated states with the same in-flow header geometry;
  • reserve subtitle and action space so hydration changes content without moving the feed;
  • enable LegendList item recycling on Android and key recycled row-local feedback to the current content;
  • parse feed timestamps once per item before sorting;
  • default review highlighting to the JavaScript engine instead of waiting for a failing native probe.

The earlier server history limits, payload preview truncation, projector changes, and associated tests were removed. Sync batching remains owned by #5344; V2 projection/runtime work remains owned by #2829 and #5080.

Verification on the rebased mobile-only diff:

  • 17 focused feed and highlighter tests passed;
  • targeted lint and formatting passed for all 10 changed files;
  • mobile native static analysis passed;
  • mobile typecheck reaches two pre-existing errors in untouched SettingsAuthRouteScreen.tsx on current main (onHostBack is missing from the installed auth view prop types).

Earlier physical-Android A/B on the same mobile rendering scope, using a 478-message / 6,696-activity signed-in thread with the 3.01 MB cached detail left intact:

  • cold open: branch loaded at ~4.2s; baseline was still loading at 4.28s and next observed loaded at ~11.8s;
  • fling frame p99: ~150ms → ~73ms;
  • PSS growth: ~161 MB → ~97 MB;
  • loading and hydrated title/action bounds stayed fixed.

Those device numbers will be re-run on the rebased head before this draft is marked ready.

Implemented with GPT-5.6 Sol in the T3 Code Codex harness.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a090384-0fe7-4923-8874-8134c87401c9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 5, 2026
Comment thread apps/mobile/src/features/threads/ThreadFeed.tsx
Comment thread apps/server/src/orchestration/ActivityPayloadProjection.ts Outdated
@shivamhwp
shivamhwp force-pushed the perf/android-large-thread-loading branch from b3d6668 to 0ebe016 Compare August 5, 2026 09:51
Comment thread apps/server/src/orchestration/ActivityPayloadProjection.ts Outdated
@shivamhwp
shivamhwp force-pushed the perf/android-large-thread-loading branch from ddcae2b to fd23be3 Compare August 7, 2026 13:49
@shivamhwp
shivamhwp force-pushed the perf/android-large-thread-loading branch from fd23be3 to f897132 Compare August 7, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant